import { HTTP } from '../../utils/api.js';

class Index extends HTTP {
  constructor(){ // 实例化构造函数
    super() // 实例化鸡肋
  }

  // 获取首页数据
  getIndeData(callback){
    var that = this;
    var params = {
      url: that.getHistoryCarListUrl,
      method:'GET',
      success:function(data){
        callback && callback(data)
      }
    }
    that.request(params);
  }

  // 根据车牌查询订单
  getFeeByCarData(meter,callback) {
    var that = this;
    var params = {
      url: that.getGetFeeByCarUrl + '?car=' + meter.car+'&validateTime='+meter.validateTime+'&orderType='+ meter.orderType,
      method: 'GET',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  }

  // 根据订单号获取订单状态
  getValidateQrCodeStateData(meter,callback) {
    var that = this;
    var params = {
      url: that.getValidateQrCodeStateUrl +  meter.code,
      method: 'GET',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  }


}
export { Index }